import React, { memo } from "react";
import { useHistory } from 'react-router-dom';
import './css.scss'
export default memo(function RechTitle(props) {
    const { title, isMore = false, moreUrl = '' } = props
    const history = useHistory();
    const handMore = () => {
        if (moreUrl) {
            history.push(moreUrl);
        }
    }
    return (
        <div className='title_box'>
            <div className='my-title'>
                <div className='title'>
                    {title}
                </div>
                {isMore ? <div onClick={e => handMore()} className='more'>查看更多</div> : ''}

            </div>
        </div>
    )
})
